home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 7473 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  811 b 

  1. Path: dispatch.news.demon.net!demon!summat.demon.co.uk
  2. From: mike@summat.demon.co.uk (Mike Dodd)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Randomness
  5. Date: Wed, 17 Apr 1996 10:17:04 GMT
  6. Message-ID: <451.6681T677T994@summat.demon.co.uk>
  7. NNTP-Posting-Host: summat.demon.co.uk
  8. X-NNTP-Posting-Host: summat.demon.co.uk
  9. X-Newsreader: THOR 2.22 (Amiga;TCP/IP)
  10.  
  11. Help !,
  12.  
  13. Has anyone got a good algorithm for quickly calculating a "random" number ?
  14.  
  15. I've tried the algorithm described in the autodocs for amiga.lib for
  16. "FastRand" :
  17.  
  18.             move.l   RandomSeed,d0
  19.             rol.l    #1,d0
  20.             eori.l   #$1d872b41,d0
  21.             move.l   d0,RandomSeed
  22.  
  23. but this produces a rather poor sequence of values...Soooerh, any better
  24. suggestions ?
  25.  
  26. --
  27. Mike    (mike@summat.demon.co.uk | fidonet@2:2500/73.10)
  28.  
  29.  
  30.